<?php

namespace App\Providers;

use App\Services\api\ILocationService;
use App\Services\api\IProductService;
use App\Services\api\IProductSkuService;
use App\Services\LocationNewService;
use App\Services\ProductService;
use App\Services\ProductSkuService;
use App\ServicesNew\CartService;
use App\ServicesNew\ConvertibleCardService;
use App\ServicesNew\CouponService;
use App\ServicesNew\CreateOrderService;
use App\ServicesNew\DistributorService;
use App\ServicesNew\Impl\CartServiceImpl;
use App\ServicesNew\Impl\ConvertibleCardServiceImpl;
use App\ServicesNew\Impl\CouponServiceImpl;
use App\ServicesNew\Impl\CreateOrderServiceImpl;
use App\ServicesNew\Impl\DistributorServiceImpl;
use App\ServicesNew\Impl\LabelServiceImpl;
use App\ServicesNew\Impl\OrderServiceImpl;
use App\ServicesNew\Impl\PaymentServiceImpl;
use App\ServicesNew\Impl\ProductSkuServiceImpl;
use App\ServicesNew\Impl\StockServiceImpl;
use App\ServicesNew\Impl\UserAddressServiceImpl;
use App\ServicesNew\Impl\UserBalanceServiceImpl;
use App\ServicesNew\LabelService;
use App\ServicesNew\OrderService;
use App\ServicesNew\PaymentService;
use  App\ServicesNew\ProductSkuService as NewProductSkuService;
use App\ServicesNew\StockService;
use App\ServicesNew\UserAddressService;
use App\ServicesNew\UserBalanceService;
use Illuminate\Support\ServiceProvider;

class NewServiceProvider extends ServiceProvider
{
    /**
     * 设定所有的单例模式容器绑定的对应关系
     *
     * @var array
     */
    public $singletons = [
        NewProductSkuService::class => ProductSkuServiceImpl::class,
        CouponService::class => CouponServiceImpl::class,
        StockService::class => StockServiceImpl::class,
        OrderService::class => OrderServiceImpl::class,
        CartService::class => CartServiceImpl::class,
        UserBalanceService::class => UserBalanceServiceImpl::class,
        LabelService::class => LabelServiceImpl::class,
        UserAddressService::class => UserAddressServiceImpl::class,
        CreateOrderService::class => CreateOrderServiceImpl::class,
        ConvertibleCardService::class => ConvertibleCardServiceImpl::class,
        PaymentService::class => PaymentServiceImpl::class,
        DistributorService::class => DistributorServiceImpl::class,
        IProductService::class => ProductService::class,  // 商品服务
        ILocationService::class => LocationNewService::class,
        IProductSkuService::class   => ProductSkuService::class, // 商品 SKU 服务
    ];

    /**
     * Register services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap services.
     *
     * @return void
     */
    public function boot()
    {
        //
    }

    /**
     * 延迟加载
     *
     * @return array|void
     */
    public function provides()
    {
        return [
            NewProductSkuService::class,
            CouponService::class,
            StockService::class,
            OrderService::class,
            CartService::class,
            UserBalanceService::class,
            LabelService::class,
            UserAddressService::class,
            CreateOrderService::class,
            ConvertibleCardService::class,
            PaymentService::class,
            DistributorService::class,
            IProductService::class,
            ILocationService::class,
            IProductSkuService::class,
        ];
    }
}
